package com.example.skycode5.dao;

import com.example.skycode5.util.DBConnection;

import java.sql.Connection;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.sql.Statement;

public class AdminDao {
    DBConnection DBConn=new DBConnection();
    public boolean CheckLogin(String s1,String s2) throws SQLException {
       Connection conn= DBConn.getConn();
        Statement stmt= conn.createStatement();
        ResultSet rs=null;
        boolean OK=true;
        String sql="SELECT * FROM admin WHERE AdminName='"+s1+"'and AdminPassword="+s2;
        rs=stmt.executeQuery(sql);
        if (!rs.next()){
            OK=false;
        }
        return OK;
    }
}
